﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RestServices
{
    public class CalendarService
    {
        public CalendarService()
        {
        }

        public string RequestCalendars(string token)
        {
            ///https://apis.live.net/v5.0/me/calendars
            string UrlRequest = "https://apis.live.net/v5.0/me/calendars?access_token=" + token;
            return (UrlRequest);            
        }

        public string RequestProperties(string token)
        {
            //GET https://apis.live.net/v5.0/calendar.611afb17fa9448f28cdb8277e8ffeb77?access_token=ACCESS_TOKEN
            string UrlRequest = "https://apis.live.net/v5.0/calendar.611afb17fa9448f28cdb8277e8ffeb77?access_token=" + token;
            return (UrlRequest);
        }

        public string RequestDeleteCalendar(string token)
        {
            //DELETE https://apis.live.net/v5.0/calendar.611afb17fa9448f28cdb8277e8ffeb77?access_token=ACCESS_TOKEN
            string UrlRequest = "https://apis.live.net/v5.0/calendar.611afb17fa9448f28cdb8277e8ffeb77?access_token=" + token;
            return (UrlRequest);
        }

        public string GetNewCalendar(string name, string accessToken)
        {
            string dataValue = "";
            dataValue += "Authorization: Bearer " + accessToken;
            dataValue += "Content-Type: application/json";
            dataValue += "{";
            dataValue += "    \"name\": \""+name+"\"";
            dataValue += "}";

            return dataValue;
        }
    }
}
